home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / binutils.7 / binutils / binutils-2.7 / gas / config / obj-elf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-04  |  4.3 KB  |  140 lines

  1. /* ELF object file format.
  2.    Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc.
  3.  
  4.    This file is part of GAS, the GNU Assembler.
  5.  
  6.    GAS is free software; you can redistribute it and/or modify
  7.    it under the terms of the GNU General Public License as published by
  8.    the Free Software Foundation; either version 1, or (at your option)
  9.    any later version.
  10.  
  11.    GAS is distributed in the hope that it will be useful,
  12.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.    GNU General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU General Public License
  17.    along with GAS; see the file COPYING.  If not, write to the Free
  18.    Software Foundation, 59 Temple Place - Suite 330, Boston, MA
  19.    02111-1307, USA.  */
  20.  
  21.  
  22. /* HP PA-RISC support was contributed by the Center for Software Science
  23.    at the University of Utah.  */
  24.  
  25. #ifndef _OBJ_ELF_H
  26. #define _OBJ_ELF_H
  27.  
  28. #define OBJ_ELF 1
  29.  
  30. #define OUTPUT_FLAVOR bfd_target_elf_flavour
  31.  
  32. #include <bfd.h>
  33.  
  34. #define BYTES_IN_WORD 4        /* for now */
  35. #include "bfd/elf-bfd.h"
  36.  
  37. /* Use this to keep track of .size expressions that involve differences
  38.    that we can't compute yet.  */
  39. #define OBJ_SYMFIELD_TYPE expressionS *
  40.  
  41. /* Symbol fields used by the ELF back end.  */
  42. #define ELF_TARGET_SYMBOL_FIELDS int local:1;
  43.  
  44. /* Don't change this; change ELF_TARGET_SYMBOL_FIELDS instead.  */
  45. #define TARGET_SYMBOL_FIELDS ELF_TARGET_SYMBOL_FIELDS
  46.  
  47. #include "targ-cpu.h"
  48.  
  49. #ifndef FALSE
  50. #define FALSE 0
  51. #define TRUE  !FALSE
  52. #endif
  53.  
  54. /* should be conditional on address size! */
  55. #define elf_symbol(asymbol) ((elf_symbol_type *)(&(asymbol)->the_bfd))
  56.  
  57. #define S_GET_SIZE(S) (elf_symbol ((S)->bsym)->internal_elf_sym.st_size)
  58. #define S_SET_SIZE(S,V) \
  59.   (elf_symbol((S)->bsym)->internal_elf_sym.st_size = (V))
  60.  
  61. #define S_GET_ALIGN(S) (elf_symbol ((S)->bsym)->internal_elf_sym.st_value)
  62. #define S_SET_ALIGN(S,V) \
  63.   (elf_symbol ((S)->bsym)->internal_elf_sym.st_value = (V))
  64.  
  65. extern asection *gdb_section;
  66.  
  67. #define obj_frob_file()    elf_frob_file()
  68.  
  69. extern void elf_frob_file PARAMS ((void));
  70. extern void elf_file_symbol PARAMS ((char *));
  71. #define obj_app_file elf_file_symbol
  72.  
  73. extern void obj_elf_section PARAMS ((int));
  74. extern void obj_elf_previous PARAMS ((int));
  75. extern void obj_elf_version PARAMS ((int));
  76.  
  77. /* BFD wants to write the udata field, which is a no-no for the
  78.    globally defined sections.  */
  79. #define obj_sec_sym_ok_for_reloc(SEC)    ((SEC)->owner != 0)
  80.  
  81. /* When setting one symbol equal to another, by default we probably
  82.    want them to have the same "size", whatever it means in the current
  83.    context.  */
  84. #define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST,SRC) \
  85.   S_SET_SIZE ((DEST), S_GET_SIZE (SRC))
  86.  
  87. /* Stabs go in a separate section.  */
  88. #define SEPARATE_STAB_SECTIONS 1
  89.  
  90. /* We need 12 bytes at the start of the section to hold some initial
  91.    information.  */
  92. extern void obj_elf_init_stab_section PARAMS ((segT));
  93. #define INIT_STAB_SECTION(seg) obj_elf_init_stab_section (seg)
  94.  
  95. /* For now, always set ECOFF_DEBUGGING for an Alpha target.  */
  96. #ifdef TC_ALPHA
  97. #define ECOFF_DEBUGGING 1
  98. #endif
  99.  
  100. /* For now, always set ECOFF_DEBUGGING for a MIPS target.  */
  101. #ifdef TC_MIPS
  102. #define ECOFF_DEBUGGING 1
  103. #endif
  104.  
  105. #if ECOFF_DEBUGGING
  106.  
  107. /* If we are generating ECOFF debugging information, we need some
  108.    additional fields for each symbol.  */
  109. #undef TARGET_SYMBOL_FIELDS
  110. #define TARGET_SYMBOL_FIELDS \
  111.   ELF_TARGET_SYMBOL_FIELDS \
  112.   struct efdr *ecoff_file; \
  113.   struct localsym *ecoff_symbol; \
  114.   valueT ecoff_extern_size;
  115.  
  116. /* We smuggle stabs in ECOFF rather than using a separate section.
  117.    The Irix linker can not handle a separate stabs section.  */
  118. #undef SEPARATE_STAB_SECTIONS
  119. #undef INIT_STAB_SECTION
  120. #define OBJ_PROCESS_STAB(seg, what, string, type, other, desc) \
  121.   ecoff_stab ((seg), (what), (string), (type), (other), (desc))
  122.  
  123. #define OBJ_GENERATE_ASM_LINENO(filename, lineno) \
  124.   ecoff_generate_asm_lineno ((filename), (lineno))
  125.  
  126. #endif /* ECOFF_DEBUGGING */
  127.  
  128. extern void elf_frob_symbol PARAMS ((struct symbol *, int *));
  129. #define obj_frob_symbol(symp, punt) elf_frob_symbol (symp, &punt)
  130.  
  131. extern void elf_pop_insert PARAMS ((void));
  132. #define obj_pop_insert()    elf_pop_insert()
  133.  
  134. #ifndef OBJ_MAYBE_ELF
  135. #define obj_ecoff_set_ext elf_ecoff_set_ext
  136. extern void elf_ecoff_set_ext ();
  137. #endif
  138.  
  139. #endif /* _OBJ_ELF_H */
  140.